< previous page page_350 next page >

Page 350
z0370-01.gif
Figure 11.17
Bezier curve blending functions.
e10a6a0a59f035e870d90cca05b85fce.gif
       (-3 * t3 + 3 * t2)
=      t
3 * (-1 + 1 + 3 -3) + t2 * (3 - 6 + 3) + t * (-3 + 3) + 1
=      1
Because the sum of the Bezier blending functions is 1 for all t, the curve essentially takes a weighted average of the endpoints and control points.
Connecting Bezier Curves
Making two Bezier curves connect is similar to making two Hermite curves connect. If two Bezier curves should meet, they must share an end point. If the curves should meet smoothly, you must also arrange their interior control points so that the tangents at the endpoints point in the same direction.
Suppose you have a curve with endpoints (x11, y11) and (x14, y14) and interior control points (x12, y12) and (x13, y13). Suppose your second curve has endpoints (x21, y21) and (x24, y24), and interior control points (x22, y22) and (x23, y23). To make the second endpoint of the first curve meet the first endpoint of the second curve, you need:
e10a6a0a59f035e870d90cca05b85fce.gif
x14 = x21
y14 = y21
To make the curves meet smoothly, you must also ensure that:
e10a6a0a59f035e870d90cca05b85fce.gif
(x14 - x13) * (y22 - y21) = (y14 - y13) * (x22 - x21) * k
for some constant k. This makes the tangent vectors <x14 x13, y14 y13> and <x22 x21, y22 x21> point in the same direction. As before, the value of the constant k depends on the relative lengths of the tangent vectors.

 
< previous page page_350 next page >